﻿using Server.Constant;
using Server.Framework.Message;
using Server.Model;

namespace Server.Message.Request
{
    /// <summary>
    /// Author: Leil
    /// Description: 请求角色列表
    /// CreateTime: 2020/5/13 10:07:46
    /// </summary>
    [MessageAttr(MessageId.REQUEST_PERMISSION_LIST)]
    class PermissionListReq : RequestBaseMessage
    {
        public int Page { get; set; }
        public int Limit { get; set; }
        public PermissionDao Condition { get; } = new PermissionDao();

        public override void Deserialize(byte[] buffer)
        {
            RequestPermissionList msg = RequestPermissionList.Parser.ParseFrom(buffer);
            Page = msg.Page;
            Limit = msg.Limit;
            if (msg.Condition != null)
            {
                Condition.ID = msg.Condition.Id;
                Condition.PerCode = msg.Condition.PerCode;
                Condition.Status = msg.Condition.Status;
            }
        }
    }
}
